home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 016 / ansicolr.arc / ANSINORM.ASM < prev    next >
Encoding:
Assembly Source File  |  1985-08-28  |  2.6 KB  |  83 lines

  1.     TITLE ANSINORM.ASM - SET FOREGROUND/BACKGROUND TO NORMAL FOR ANSI.SYS
  2.     page 60,132
  3.  
  4. ;    written by Terry Barr - CIS 70406,377 or Gene Plantz's IBBS.
  5. ;    August 26, 1985
  6.  
  7. comment *    ESC [2J - Erases all of screen and the cursor
  8.               goes to the home position.
  9.  
  10.         parameters for SGR (set graphics rendition)
  11.         
  12.         page 3-15 in IBM DOS Technical Reference Manual
  13.         
  14.         ESC [#;...;#m - sets the character attribute specified
  15.         by the parameters.  All following characters have the
  16.         attribute according to the parameters until the next
  17.         occurence of SGR.
  18.  
  19.         Parameter    Meaning
  20. ---------->>>    0        All attributes off (normal white on black)
  21.         1        Bold on (high intensity)
  22.         4        Underscore on (IBM Mono Display only)
  23.         5        Blink on
  24.         7        Reverse video on
  25.         8        Canceled on (invisible)
  26.         30        Black foreground
  27.         31        Red foreground
  28.         32        Green foreground
  29.         33        Yellow foreground
  30.         34        Blue foreground
  31.         35        Magenta foreground
  32.         36        Cyan foreground
  33.         37        White foreground
  34.         40        Black background
  35.         41        Red background
  36.         42        Green background
  37.         43        Yellow background
  38.         44        Blue background
  39.         45        Magenta background
  40.         46        Cyan background
  41.         47        White background
  42. *
  43. CSEG    SEGMENT PARA PUBLIC 'CODE'
  44.     ASSUME CS:CSEG,DS:CSEG
  45.  
  46.     ORG    100H
  47. ENTPT:    JMP    SHORT START
  48. COLOR    DB    27,'[0m',27,'[2J'    ; return to norm attr. & clear screen
  49. COLSIZ    EQU    $-COLOR            ; length of above message
  50. HANDLE    EQU    1            ; handle for standard output
  51. SF9    DB    27,'[0;92;"ANSINORM";13p' ;<<------------------------------
  52. SF9SIZ    EQU    $-SF9              ;<< you can remove these lines
  53. SF10    DB    27,'[0;93;"ANSICOLR";13p' ;<< if you don't want to be able
  54. SF10SIZ    EQU    $-SF10              ;<< to run programs from
  55.                       ;    SHIFT F9 & F10.
  56.                       ;-------------------------------    
  57. START    PROC    NEAR
  58.     MOV    BX,HANDLE        ; standard output device
  59.     MOV    CX,COLSIZ        ; get size of text to be sent
  60.     MOV    DX,OFFSET COLOR        ; pass offset of string to be sent
  61.     MOV    AH,40H            ; function= 'write to device'
  62.     INT    21H            ; call dos
  63.  
  64. ; ********* you can remove all lines between the stars to get rid **********
  65. ; ********* of the automatic running of these programs. ********************
  66.  
  67.     MOV    BX,HANDLE        ; standard output device
  68.     MOV    CX,SF9SIZ        ; get size of text to be sent
  69.     MOV    DX,OFFSET SF9        ; pass offset of string to be sent
  70.     MOV    AH,40H            ; function= 'write to device'
  71.     INT    21H            ; call dos
  72.     MOV    BX,HANDLE        ; standard output device
  73.     MOV    CX,SF10SIZ        ; get size of text to be sent
  74.     MOV    DX,OFFSET SF10        ; pass offset of string to be sent
  75.     MOV    AH,40H            ; function= 'write to device'
  76.     INT    21H            ; call dos
  77. ; *************************************************************************
  78.     RET
  79. START    ENDP
  80.  
  81. CSEG    ENDS
  82.     END    ENTPT
  83.